package team.freeroom.hotelmanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import team.freeroom.hotelmanage.repository.entity.Room;
import team.freeroom.hotelmanage.repository.mapper.RoomMapper;
import team.freeroom.hotelmanage.service.RoomService;

import java.util.List;
import java.util.Map;

@Service
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;

    @Override
    public int add(Room room) {
        return roomMapper.add(room);
    }

    @Override
    public int edit(Room room) {
        return roomMapper.edit(room);
    }

    @Override
    public int delete(Long id) {
        return roomMapper.delete(id);
    }

    @Override
    public List<Room> findList(Map<String, Object> queryMap) {
        return roomMapper.findList(queryMap);
    }

    @Override
    public List<Room> findAll() {
        return roomMapper.findAll();
    }

    @Override
    public Integer getTotal(Map<String, Object> queryMap) {
        return roomMapper.getTotal(queryMap);
    }

    @Override
    public Room find(Long id) {
        return roomMapper.find(id);
    }

    @Override
    public Room findBySn(String sn) {
        return roomMapper.findBySn(sn);
    }
}
